package com.qf.controller;

import com.qf.pojo.RepairsForm;
import com.qf.pojo.resp.BaseResult;
import com.qf.service.RepairsFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/RepairsForm")
@CrossOrigin
public class RepairsFormController {

    @Autowired
    RepairsFormService repairsFormService;

    @RequestMapping("/findAll")
    public BaseResult findAllRepairs(){
        BaseResult result = repairsFormService.findAllRepairs();
        return result;
    }

    @RequestMapping("/addOne")
    public BaseResult addOne(@RequestBody RepairsForm repairsForm){
        System.out.println(repairsForm);
        BaseResult result = repairsFormService.addOne(repairsForm);
        return result;
    }
}
